/** * @license * Copyright 2018 JBoss Inc * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import { Oas20Schema, Oas30Schema, SimplifiedPropertyType, Aai20Schema } from "apicurio-data-models"; import { EntityEditor, EntityEditorEvent, IEntityEditorHandler } from "./entity-editor.component"; import { DropDownOption } from "../../../../../../components/common/drop-down.component"; import Oas20PropertySchema = Oas20Schema.Oas20PropertySchema; import Oas30PropertySchema = Oas30Schema.Oas30PropertySchema; import Aai20PropertySchema = Aai20Schema.Aai20PropertySchema; export interface PropertyData { name: string; description: string; type: SimplifiedPropertyType; } export interface PropertyEditorEvent extends EntityEditorEvent { data: PropertyData; } export interface IPropertyEditorHandler extends IEntityEditorHandler { onSave(event: PropertyEditorEvent): void; onCancel(event: PropertyEditorEvent): void; } export declare class PropertyEditorComponent extends EntityEditor { props: string[]; propExists: boolean; model: PropertyData; doAfterOpen(): void; /** * Initializes the editor's data model from a provided entity (initialize the editor data model from an entity). * @prop entity */ initializeModelFromEntity(entity: Oas20PropertySchema | Oas30PropertySchema | Aai20PropertySchema): void; /** * Initializes the editor's data model to an empty state. */ initializeModel(): void; /** * Returns true if the data model is valid. */ isValid(): boolean; /** * Creates an entity event specific to this entity editor. */ entityEvent(): PropertyEditorEvent; /** * Gets the array of properties for the current context. */ private getProps; isRequired(): boolean; required(): string; requiredOptions(): DropDownOption[]; type(): string; typeOptions(): DropDownOption[]; typeOf(): string; typeOfOptions(): DropDownOption[]; typeAs(): string; typeAsOptions(): DropDownOption[]; shouldShowEnumEditor(): boolean; shouldShowFormattedAs(): boolean; changeRequired(newValue: string): void; changeType(type: string): void; changeTypeEnum(value: string[]): void; changeTypeOf(typeOf: string): void; changeTypeAs(typeAs: string): void; private addRefTypes; }